package com.gist.cithub.evaluate.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gist.common.utils.PageUtils;
import com.gist.common.utils.Query;

import com.gist.cithub.evaluate.dao.DetailInforDao;
import com.gist.cithub.evaluate.entity.DetailInforEntity;
import com.gist.cithub.evaluate.service.DetailInforService;


@Service("detailInforService")
public class DetailInforServiceImpl extends ServiceImpl<DetailInforDao, DetailInforEntity> implements DetailInforService {
    @Autowired
    DetailInforDao detailInforDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<DetailInforEntity> page = this.page(
                new Query<DetailInforEntity>().getPage(params),
                new QueryWrapper<DetailInforEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<DetailInforEntity> getDetailInforBySumid(Integer sumid) {
        QueryWrapper<DetailInforEntity>queryWrapper=new QueryWrapper<>();
        queryWrapper.and(
                wrapper -> wrapper.eq("sum_id",sumid)
        );
        List<DetailInforEntity> detailInforEntityList=detailInforDao.selectList(queryWrapper);
        return detailInforEntityList;
    }

}